package com.king.java.tools.network.entity;

import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.Arrays;
import java.util.List;

/**
 * 描述: 网络接口设备信息类
 *
 * @author : sujinchen
 * @date : 2020/10/11
 */
public class NetworkInfo {
    /**
     * 网路设备名称
     */
    private String name;

    /**
     * 网络设备显示名称
     */
    private String DisplayName;

    /**
     * 网络接口索引
     */
    private Integer index;

    /**
     * 是否开启并运行
     */
    private Boolean isUp;

    /**
     * 是否为回调接口
     */
    private Boolean isLookback;

    /**
     * MTU大小，默认1500字节，IPv6中范围1280~65535
     */
    private Integer MTU;

    /**
     * 是否为虚拟子接口
     */
    private Boolean isVirtual;

    /**
     * 父接口
     */
    private NetworkInterface parent;

    /**
     * 子接口
     */
    private List<NetworkInterface> childs;

    /**
     * 硬件(MAC)地址信息
     */
    private String[] MAC;

    /**
     * IP地址信息
     */
    private List<InetAddress> IP;

    /**
     * 是否为点对点设备
     */
    private Boolean isPointToPoint;

    /**
     * 是否支持多播
     */
    private Boolean supportsMulticast;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDisplayName() {
        return DisplayName;
    }

    public void setDisplayName(String displayName) {
        DisplayName = displayName;
    }

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }

    public Boolean getUp() {
        return isUp;
    }

    public void setUp(Boolean up) {
        isUp = up;
    }

    public Boolean getLookback() {
        return isLookback;
    }

    public void setLookback(Boolean lookback) {
        isLookback = lookback;
    }

    public Integer getMTU() {
        return MTU;
    }

    public void setMTU(Integer MTU) {
        this.MTU = MTU;
    }

    public Boolean getVirtual() {
        return isVirtual;
    }

    public void setVirtual(Boolean virtual) {
        isVirtual = virtual;
    }

    public NetworkInterface getParent() {
        return parent;
    }

    public void setParent(NetworkInterface parent) {
        this.parent = parent;
    }

    public List<NetworkInterface> getChilds() {
        return childs;
    }

    public void setChilds(List<NetworkInterface> childs) {
        this.childs = childs;
    }

    public String[] getMAC() {
        return MAC;
    }

    public void setMAC(String[] MAC) {
        this.MAC = MAC;
    }

    public List<InetAddress> getIP() {
        return IP;
    }

    public void setIP(List<InetAddress> IP) {
        this.IP = IP;
    }

    public Boolean getPointToPoint() {
        return isPointToPoint;
    }

    public void setPointToPoint(Boolean pointToPoint) {
        isPointToPoint = pointToPoint;
    }

    public Boolean getSupportsMulticast() {
        return supportsMulticast;
    }

    public void setSupportsMulticast(Boolean supportsMulticast) {
        this.supportsMulticast = supportsMulticast;
    }

    @Override
    public String toString() {
        return "NetworkInfo{" +
                "name='" + name + '\'' +
                ", DisplayName='" + DisplayName + '\'' +
                ", index=" + index +
                ", isUp=" + isUp +
                ", isLookback=" + isLookback +
                ", MTU=" + MTU +
                ", isVirtual=" + isVirtual +
                ", parent=" + parent +
                ", childs=" + childs +
                ", MAC=" + Arrays.toString(MAC) +
                ", IP=" + IP +
                ", isPointToPoint=" + isPointToPoint +
                ", supportsMulticast=" + supportsMulticast +
                '}';
    }
}
